<?php
   class SF_AutoCoupon_Block_View extends Mage_Core_Block_Template
   {

    protected function _toHtml()
    {
        $code = $this->getEventsCode();
        $this->setTemplate('autocoupon/view/'.$code.'.phtml');
        return parent::_toHtml();
    }
    public function getEventsCode(){
        return $this->getRequest()->getParam("code");
    }
   }